package com.itheima.mm.mapper;

import com.github.pagehelper.Page;
import com.itheima.mm.entity.UserPageQueryParams;
import com.itheima.mm.pojo.Course;
import com.itheima.mm.pojo.User;
import com.itheima.mm.vo.CourseVO;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface  UserMapper {

    @Select ("select * from t_user where username = #{username}")
    User getByUsername(String username);
    Page<User> findByCondition(UserPageQueryParams queryParams);
    @Insert("INSERT INTO t_user VALUES (null,#{username}, #{password}, #{state}, #{email}, #{source}, #{createDate}, #{remark})")
    void insert(User user);
    @Select("select * from t_user where id = #{id}")
    User findById(Integer id);


    void update(User user);
    Integer deleteUser(Integer id);


}
